package com.afdor.rws.dtm.api.exception;

/**
 * Description: transaction exception <br/>
 * ClassName: com.afdor.rws.dtm.api.exception.TransactionException.java <br/>
 *
 * @author <a href="mailto:scwsl@foxmail.com">悭梵</a>
 * @version V1.0
 * @date Created in 2019-01-20 11:23
 * @since JDK 1.8
 */
public class TransactionException extends Exception {


    protected TransactionExceptionCode code = TransactionExceptionCode.UNKNOWN;

    public TransactionException(TransactionExceptionCode code) {
        setCode(code);
    }

    public TransactionException(TransactionExceptionCode code, Throwable cause) {
        super(cause);
        setCode(code);
    }

    public TransactionException(TransactionExceptionCode code, String message) {
        super(message);
        setCode(code);
    }

    public TransactionException(TransactionExceptionCode code, String message, Throwable cause) {
        super(message, cause);
        setCode(code);
    }

    public TransactionExceptionCode getCode() {
        return code;
    }

    protected void setCode(TransactionExceptionCode code) {
        this.code = code;
    }
}

